<?php

namespace app\modelOpreate\invite;

use app\factory\Factory;
use app\model\invite\BrowsingHistory;
use app\modelOpreate\ModelOpeBase;
use think\facade\Db;

/**
 * ClassName:浏览记录操作类
 * @author leijunxiang
 * @time 2024/11/6
 * @auditor
 */
class BrowsingHistoryOpe extends ModelOpeBase
{
    const TOOL_BROWSING_HISTORY_OPE = "BrowsingHistoryOpe";
    /**
     * 获取浏览记录对象用户id
     */
    public function getInviteObj($userId)
    {
        $arr = Db::table($this->table)->where("userId", "=", $userId)->find();
        $obj = null;
        if($arr){
            $obj = Factory::getInstance()->getModelObj(BrowsingHistory::MODEL_BROWSING_HISTORY, $arr['userId']);
            $obj->setAttribute($arr);
        }

        return $obj;
    }

}